﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Collections.Generic;
using ThanNhanTao.Server.Entities;
using ThanNhanTao.Server;
using ThanNhanTao.Server.Enum;
using ThanNhanTao.ListTemp;
using ThanNhanTao.Server.BLL;

namespace ThanNhanTao.Report
{
    public partial class rptThongKeTongBNChayThan : DevExpress.XtraReports.UI.XtraReport
    {
        #region Fields

        int stt;

        #endregion

        public rptThongKeTongBNChayThan()
        {
            InitializeComponent();
        }

        public void BindDetail(bool thongKeChayThan)
        {
            colMaNV.DataBindings.Add("Text", DataSource, "SoNhapVien");
            colHo.DataBindings.Add("Text", DataSource, "Ho");
            colTen.DataBindings.Add("Text", DataSource, "Ten");
            colGioiTinh.DataBindings.Add("Text", DataSource, "GioiTinhString");
            colTuoi.DataBindings.Add("Text", DataSource, "Tuoi");
            colTinhTrang.DataBindings.Add("Text", DataSource, "TinhTrangBenhNhan");
            colKhu.DataBindings.Add("Text", DataSource, "Khu");
            if (thongKeChayThan)
                colNgayChay.DataBindings.Add("Text", DataSource, "NgayChay", "{0:dd/MM/yyyy}");
            colSoBHYT.DataBindings.Add("Text", DataSource, "SoBHYT");
        }

        public void BindGroupFooter(int tongBenhNhan)
        {
            colTongBenhNhan.Text = String.Format("{0} lần chạy", tongBenhNhan);
        }

        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            stt++;
            colSTT.Text = stt.ToString();
        }
    }

    
}
